//
//  LookHotTravelTableViewCell.m
//  Qyer
//
//  Created by 赵宇 on 15/9/9.
//  Copyright (c) 2015年 赵宇. All rights reserved.
//

#import "LookHotTravelTableViewCell.h"
#import "BaseHeader.h"
@implementation LookHotTravelTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.photoview = [[UIImageView alloc]initWithFrame:CGRectMake(5, 5, SCREEN_WIDTH/3, SCREEN_WIDTH/4)];
        [self.contentView addSubview:self.photoview];
        
        self.titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(15+SCREEN_WIDTH/3, 0, SCREEN_WIDTH/5*3, SCREEN_WIDTH/8)];
        self.titleLabel.numberOfLines = 2;
        self.titleLabel.font = [UIFont systemFontOfSize:14.];
        [self.contentView addSubview:self.titleLabel];
        
        self.usernameLabel = [[UILabel alloc]initWithFrame:CGRectMake(15+SCREEN_WIDTH/3, SCREEN_WIDTH/8,SCREEN_WIDTH/5*3, SCREEN_HEIGHT/15)];
        self.usernameLabel.font = [UIFont systemFontOfSize:13.];
        self.usernameLabel.textColor = [UIColor grayColor];
        [self.contentView addSubview:self.usernameLabel];
        
        self.viewsLabel = [[UILabel alloc]initWithFrame:CGRectMake(15+SCREEN_WIDTH/3, SCREEN_WIDTH/4-SCREEN_HEIGHT/25, SCREEN_WIDTH/3, SCREEN_HEIGHT/15)];
        self.viewsLabel.textColor = [UIColor grayColor];
        self.viewsLabel.font = [UIFont systemFontOfSize:13.];
        [self.contentView addSubview:self.viewsLabel];
        
        self.replysLabel = [[UILabel alloc]initWithFrame:CGRectMake(35+SCREEN_WIDTH/3*2, SCREEN_WIDTH/4-SCREEN_HEIGHT/25, SCREEN_WIDTH/4, SCREEN_HEIGHT/15)];
        self.replysLabel.font = [UIFont systemFontOfSize:14.];
        self.replysLabel.textColor = [UIColor grayColor];
        [self.contentView addSubview:self.replysLabel];
    }
    return self;
}
-(void)setUpWithModel:(LookHotTravelModel *)model
{
    NSURL *url = [NSURL URLWithString:model.photo];
    [self.photoview sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"zhanweiPic"]];
    self.titleLabel.text = model.title;
    self.usernameLabel.text = model.username;
    NSString *viewString = [NSString stringWithFormat:@"点击量%@",model.views.stringValue];
    self.viewsLabel.text = viewString;
    NSString *replysString = [NSString stringWithFormat:@"评论%@",model.replys];
    self.replysLabel.text = replysString;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
